//
//  AppDelegate.m
//  MiWei
//
//  Created by 刘星 on 2017/9/29.
//  Copyright © 2017年 miwei. All rights reserved.
//

#import "AppDelegate.h"
#import "MGJRouter.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.rootViewController = [self setUpRootViewController];
    [self.window makeKeyAndVisible];
    return YES;
}

- (UIViewController *)setUpRootViewController {
    
    UIViewController *rootVC = [MGJRouter objectForURL:@"miwei://getRootVC"];
    UIViewController *homeVc = [MGJRouter objectForURL:@"miwei://getHomeVc"];
    [MGJRouter openURL:@"miwei://addChildVC" withUserInfo:@{
                                                            @"vc": homeVc,
                                                            @"nImg": @"tabbar_home",
                                                            @"sImg": @"tabbar_home_highlighted",
                                                            @"title": @"首页"
                                                            } completion:^(id result) {
                                                                NSLog(@"%@", result);
                                                            }];
    [MGJRouter openURL:@"miwei://addChildVC" withUserInfo:@{
                                                            @"vc": [UIViewController new],
                                                            @"nImg": @"tabbar_live",
                                                            @"sImg": @"tabbar_live_highlighted",
                                                            @"title": @"直播"
                                                            } completion:^(id result) {
                                                                NSLog(@"%@", result);
                                                            }];
    [MGJRouter openURL:@"miwei://addChildVC" withUserInfo:@{
                                                            @"vc": [UIViewController new],
                                                            @"nImg": @"tabbar_service",
                                                            @"sImg": @"tabbar_service_highlighted",
                                                            @"title": @"社区"
                                                            } completion:^(id result) {
                                                                NSLog(@"%@", result);
                                                            }];
    [MGJRouter openURL:@"miwei://addChildVC" withUserInfo:@{
                                                            @"vc": [UIViewController new],
                                                            @"nImg": @"tabbar_ community",
                                                            @"sImg": @"tabbar_ community_highlighted",
                                                            @"title": @"课程"
                                                            } completion:^(id result) {
                                                                NSLog(@"%@", result);
                                                            }];
    [MGJRouter openURL:@"miwei://addChildVC" withUserInfo:@{
                                                            @"vc": [UIViewController new],
                                                            @"nImg": @"tabbar_ proflie",
                                                            @"sImg": @"tabbar_ proflie_highlighted",
                                                            @"title": @"我的"
                                                            } completion:^(id result) {
                                                                NSLog(@"%@", result);
                                                            }];
    return rootVC;
    
}

@end
